package com.wdd.myplatform.controller.pulsar;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wdd 2022/7/18
 */
@RequestMapping("/pulsarController")
@RestController
public class PulsarController {

    /*@Autowired
    private PulsarService pulsarService;

    @Autowired
    private PulsarCommon pulsarCommon;

    @Autowired
    private PulsarMsgListener pulsarMsgListener;

    @GetMapping("/sendMsg")
    public String sendMsg(){
        String randomAlphabetic = RandomStringUtils.randomAlphabetic(10);
        return pulsarService.sendObservation(randomAlphabetic);
    }

    @GetMapping("/sendMsg1")
    public void sendMsg1(){
        pulsarCommon.createConsumer("enen", "test", pulsarMsgListener, Schema.BYTES);
        Producer producer = pulsarCommon.createProducer("enen", Schema.BYTES);
        try {
            producer.newMessage()
                    .key("a12312312")
                    .value("嗯嗯的消息".getBytes())
                    .send();
        } catch (PulsarClientException e) {
            e.printStackTrace();
        }
    }*/


}
